package com.zhangjie.cmn.client;

import com.zhangjie.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


//@FeignClient("service-cmn")//要调用的服务名字
@FeignClient(name = "service-cmn", path = "/admin/cmn/dict")
public interface DictFeignClient {
    //根据dictCode和value查询
    @GetMapping("/getName/{dictCode}/{value}")
    String getName(@PathVariable("dictCode") String dictCode,
                          @PathVariable("value") String value);

    //根据value查询
    @GetMapping("/getName/{value}")
    String getName(@PathVariable("value") String value);

    //根据dictCode获取下级节点
    @GetMapping("findByDictCode/{dictCode}")
    Result findByDictCode(@PathVariable String dictCode);

    //根据数据id查询子数据列表
    @GetMapping("/findChildData/{id}")
    Result findChildData(@PathVariable Long id);
}
